package model;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;

import dao.GetCnn;

import entity.Quangcao;

public class QuangcaoModel {
	public List<Quangcao> getlistqc(String strSearch) throws SQLException{
		List<Quangcao> list = new ArrayList<Quangcao>();
		Connection cnn = GetCnn.getCnn();
		Statement stat = cnn.createStatement();
		ResultSet rs = stat.executeQuery(strSearch);
		while (rs.next()){
			Quangcao entity = new Quangcao();
			entity.setMaqc(rs.getString("maqc"));
			entity.setTenqc(rs.getString("tenqc"));
			entity.setCongty(rs.getString("congty"));
			entity.setUrlhinh(rs.getString("URLHINH"));
			entity.setVitri(rs.getString("vitri"));
			list.add(entity);
		}
		return list;
	}

}
